CentOS 7
Sponsored Link

PostgreSQL 9.6 : Install phpPgAdmin
2017/10/31
 
Install phpPgAdmin to operate PostgreSQL on web browser from Client hosts.
[1]
[2]
[3] Install phpPgAdmin.
# install from EPEL, Remi

[root@www ~]#
yum --enablerepo=epel,remi -y install phpPgAdmin php70-php-pgsql
[root@www ~]#
vi /etc/phpPgAdmin/config.inc.php
# line 18: add

$conf['servers'][0]['host'] = '
localhost
';
# line 35: change

$conf['servers'][0]['pg_dump_path'] = '
/opt/rh/rh-postgresql96/root/usr/bin/pg_dump
';
$conf['servers'][0]['pg_dumpall_path'] = '
/opt/rh/rh-postgresql96/root/usr/bin/pg_dumpall
';
# line 93: change to false if you allow to login with priviledged user like postgres, root

$conf['extra_login_security'] =
false
;
# line 99: change

$conf['owned_only'] =
true
;
[root@www ~]#
vi /var/opt/rh/rh-postgresql96/lib/pgsql/data/pg_hba.conf
# line 82: change like follows and add access permission

host    all             all             127.0.0.1/32            md5
host    all             all             10.0.0.0/24             md5
host    all             all             ::1/128                 md5

[root@www ~]#
vi /etc/httpd/conf.d/phpPgAdmin.conf
# line 11: add access permission

Require local
Require ip 10.0.0.0/24
[root@www ~]#
systemctl restart httpd rh-postgresql96-postgresql

[4] If SELinux is enabled, change boolean setting.
[root@www ~]#
setsebool -P httpd_can_network_connect_db on

[5] Access to the [http://(hostname or IP address)/phpPgAdmin/] and click [PostgreSQL] on the left pane.
[6] Autenticate a user and password which is in PostgreSQL.
[7] Just logined. You can operate PostgreSQL on here.
 
Tweet